package cn.uin.domain.auth.service.user.register;

import cn.uin.domain.auth.model.entity.HomeUserEntity;
import cn.uin.domain.auth.model.entity.HomeUserRegisterEntity;

/**
 * @ClassName AbstractRegisterService
 * @Description:用户注册抽象类
 * @Author: Administrator
 * @CreateDate: 2025/10/22 10:51
 * @Version: 1.0
 */
public abstract class AbstractRegisterService implements IRegisterStrategyService {

	@Override
	public HomeUserEntity register(HomeUserRegisterEntity homeUserRegisterEntity) {
		checkUser(homeUserRegisterEntity);
		return doRegister(homeUserRegisterEntity);
	}

	/**
	 * 校验用户合法性
	 * @param homeUserRegisterEntity
	 */
	protected abstract void checkUser(HomeUserRegisterEntity homeUserRegisterEntity);

	/**
	 * 注册
	 * @param homeUserRegisterEntity
	 * @return
	 */
	protected abstract HomeUserEntity doRegister(HomeUserRegisterEntity homeUserRegisterEntity);
}
